const { orderModel } = require('./models/orderModel');
//获取订单信息
module.exports.getOrders = async params => {
    console.log(params._id);
    const data = await orderModel
        .find()
        .populate('orderSales');
    return data;
}
//获取修改ID
module.exports.updateOrdersId = async params => {
    let data = await orderModel.find(params)
    return data;
}

//修改订单
module.exports.updateOrders = async params => {
    let data = await orderModel.updateOne({ _id: params._id }, params)
    return data;
}
//删除订单
module.exports.deleteOrders = async params => {
    let data = await orderModel.deleteOne({ _id: params._id })
    return data;
}